package com.nc.mem.tests.poly.c;

import com.nc.mem.tests.poly.b.B;

public class C extends B {

	static C newC() {
		final C c = new C();
		c.a = true;
		c.b = 1;
		c.setC('C');
		c.setD((short) 32000);
		c.setE(101010);
		c.setF(2.7182f);
		c.setG(Long.MAX_VALUE);
		c.setH(3.141592);
		c.setI("Coool");
		c.setJ(false);
		c.setK('K');
		c.setL((short) 12);
		c.setM(3213421);
		c.setN(1.618f);
		c.setO(Long.MIN_VALUE);
		c.setP(1.168 * 1.618);

		c.q = 12;
		c.r = "Short str";

		return c;
	}

	int q;

	String r;

	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final C other = (C) obj;
		if (q != other.q) {
			return false;
		}
		if (r == null) {
			if (other.r != null) {
				return false;
			}
		} else if (!r.equals(other.r)) {
			return false;
		}
		return true;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + q;
		result = prime * result + (r == null ? 0 : r.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return super.toString() + " => " + "C [j=" + q + ", k=" + r + "]";
	}

}
